#!/bin/bash
#grep 'image: .*' -rn ./ | awk -F: '/manifest/{print $(NF-1)":"$NF}' > images.txt

NAMESPACE="fudata-test"

while read image
do
    docker pull $image

    NAME=$(echo $image | awk -F/ '{print $NF}')
    docker tag $image registry.cn-hangzhou.aliyuncs.com/${NAMESPACE}/${NAME}
    docker push registry.cn-hangzhou.aliyuncs.com/${NAMESPACE}/${NAME}
done < images.txt
